#pragma once
#include "dxroids.h"
#include "GameObject.h"
#include "Particle.h"
#include "Vector.h"

#include <vector>
#include <memory>

namespace dxroids
{  
   class Explosion : public GameObject
   {

   public:

      Explosion(Vector const & _pos, float _max_radius);      
      virtual ~Explosion();

      static std::unique_ptr<GameObject> NewDefault(Vector const & _pos);

      virtual void UpdateFrame(GameTime const & _timer, ClippingInformation const & _clip, 
         bool * _wrap_horizontal, bool * _wrap_vertical) override;

      virtual void Render(RenderContext const & _ctx) override;

   private:

      virtual DXROIDS_COM_PTR<ID2D1Geometry> CreateGeometry(DXROIDS_COM_PTR<ID2D1Factory> const & _factory,
         float _scale) override;      

   private:      

      std::vector<std::unique_ptr<Particle>> particles_;      
      float max_radius_;      
      int frame_count_;
   };
}